Skip to content

Conversation

Dot-H
Copy link

@Dot-H Dot-H commented Sep 17, 2024

As the AssertNoCacheWorksForMultiMap tests shows, when the QueryAsync method is passed a splitOn and map arguments, the NoCache flag is actually ignored.

The issue seems to come from here

Signed-off-by: Alexandre Bernard <alexandre.bernard@gopigment.com>
Signed-off-by: Alexandre Bernard <alexandre.bernard@gopigment.com>
Comment on lines +1013 to +1014
await MarsConnection.QueryAsync<int, int, (int, int)>(cmdDef, splitOn: "b", map: (a, b) => (a, b));
Assert.Equal(0, SqlMapper.GetCachedSQLCount());
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fails. SqlMapper.GetCachedSQLCount() actually returns 1

Assert.Equal(0, before);

await MarsConnection.QueryAsync<(int, int)>(cmdDef);
Assert.Equal(0, SqlMapper.GetCachedSQLCount());
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this pass

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant